Skip to content

trivial-httpd: Fix const-correctness of slash pointer#3579

Open
kraj wants to merge 1 commit intoostreedev:mainfrom
kraj:kraj/clang-22
Open

trivial-httpd: Fix const-correctness of slash pointer#3579
kraj wants to merge 1 commit intoostreedev:mainfrom
kraj:kraj/clang-22

Conversation

@kraj
Copy link
Copy Markdown
Contributor

@kraj kraj commented Apr 9, 2026

strrchr() returns a 'const char *' when passed a 'const char *' argument. Declare the local 'slash' variable as 'const char *' to match, fixing a build failure with clang when
-Werror,-Wincompatible-pointer-types-discards-qualifiers is active.

strrchr() returns a 'const char *' when passed a 'const char *'
argument. Declare the local 'slash' variable as 'const char *'
to match, fixing a build failure with clang when
-Werror,-Wincompatible-pointer-types-discards-qualifiers is active.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 9, 2026

Hi @kraj. Thanks for your PR.

I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the do_get function in src/ostree/ostree-trivial-httpd.c to change the type of the slash variable from char * to const char *, which improves type safety by ensuring the string it points to is treated as immutable. I have no feedback to provide as there were no review comments.

@ericcurtin
Copy link
Copy Markdown
Collaborator

@kraj you got unlucky with the build... Since const is only a build-time check, if it builds this is good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants